//Rationalcompare.cpp is a .cpp written by Daniel Hirst 3/26/2014	

#include "Rationalcompare.h"
using namespace std;	
				
	
			 //this is a comparison function essentially you compare the Kurtosis and compare it to Extreme and Minor. I have picked arbitrary
			 //boundaries for those 2 values. Extreme is if deviations in the bearing are to do large extreme deviations and Minor is for
			 //frequent modest deviations. Exceding either value return an appropiate string message
			 string Reason(double kurtosis)
			 {
				 int Extreme = 3;
				 int Minor = -3;
				
				 string extremeMess = "Bearing is not acceptably round do to Extreme deviations";
				 string minorMess = "Bearing is not acceptably round do to frequent minor deviations";
				 string noMess = "This bearing is acceptably round";
				 //string answer = "";
	
				

				 if (kurtosis > Extreme){
						
						return(extremeMess);}
					 //richTextBox1->AppendText(" " + "Bearing is not acceptably round do to Extreme deviations" + " ");
				 else if (kurtosis < Minor){
						
						return(minorMess);}
				 //richTextBox1->AppendText(" " + "Bearing is not acceptably round do to frequent minor deviations"+ " ");
				 else
						
						return(noMess);
				 
					 //richTextBox1->AppendText(" " + "This bearing is acceptably round"+ " ");

			 }

			 string SkewK(double skew){
				 
				 int skewcheck = 0;

				 string largeradius = "Bearing's radii is skewed towards larger values";
				 string smallradius = "Bearing's radii is skewed towards smaller values";
				 string noskew = "Bearing has radii has no skew";

				  if (skew > skewcheck)
					 return(largeradius);
				 else if (skew < skewcheck)
					 return(smallradius);
				 else
				 {
					return(noskew);
				 }
			 }